\section{Web service's installation guide}

In this section we explain how to install the web service in a \emph{Debian} linux distribution.

Notice that as the web service is the database's client over \emph{TCP/IP} these two services could be in different computers. Even the web service and it's definition could be in a different host. The web services's WSDL that is provided could point to the real web service methods in another URL. Even though we are going to explain how to install everything in the same computer.

\subsection{MySQL Server}

We have to install the \emph{MySQL} database server, which in the \emph{Debian} distributions can be found in the official repositories. In order to do this we can use a graphical application like \emph{Synaptic} and search the \emph{mysql-server} package to install it.

If we don't have a graphical enviroment, what is common servers, we can do it using the shell as follows. First of all log in the system as \emph{root}. Then run the command "\emph{apt-get install mysql-server}" and press "\emph{Y}" when you asked for the confirmation and wait.

During the installation you will be asked to set the databases \emph{root} accounts password. This is the account is going to has all the rigths to change the database, so we will use this to create the \emph{fflocation} account for the web service and import the database from the \emph{fflocation.sql} file.

\emph{mysql -u root -p}

\emph{Enter password:} Enter the root password for the mysql server account.

Now that you are logged in, we create a database.

\emph{mysql\textgreater create database fflocation;}

We allow user fflocation to connect to the server from localhost using the password fflocation:

\emph{mysql\textgreater grant usage on *.* to fflocation@localhost identified by 'fflocation';}

And finally we grant all privileges on the fflocation database to this user:
\emph{mysql\textgreater grant all privileges on fflocation.* to fflocation@localhost;}

Now that the fflocation user is "owner" of the fflocation database, we are going to use this user to import the whole database struct with some user information, history and notes. All this are in the \emph{fflocation.sql} file. The \emph{-u} parameter specifies the user, the \emph{-p} the database and the last parameter takes as the command input the SQL file.

\emph{mysql -u fflocation -p fflocation \textless fflocation.sql}

Debian sets by default the database to run all the time and when the computer starts up so the database server is ready by now.


\subsection{Tomcat Server}

Now to offer the web services methods we have to use the \emph{Tomcat} server. The implemented web service requires what now is the latest version, \emph{Tomcat 7.0}. The web service application is in the \emph{fflServer.war} file.

First thing to do is to get the software, the easiest way to do it is downloading it from \emph{http://tomcat.apache.org/download-70.cgi}. Choose the \emph{tar.gz}, download it a uncompress it. Then copy the \emph{fflServer.war} file into Tomcat's "\emph{webapps}" folder and the \emph{mysql-connector-java-5.1.13-bin.jar} to the "\emph{lib}" folder. First one is the web service code and the second one the driver it uses to access de \emph{MySQL} database.

Then run the \emph{startup.sh} script in the bin folder to start the server. At this point the web service should be working and providing all its the methods and the definition in the \emph{WSDL} file.

You can use the \emph{SoapUI} to test the web service. The \emph{WSDL} file should be located in the following URL:

\emph{http://localhost:8080/fflServer/services/FFLocationAPI?wsdl}